//
//  VideoViewController.m
//  SkillzOn
//
//  Created by iD Student on 7/27/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "VideoViewController.h"


@interface VideoViewController ()

@end

@implementation VideoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{ 
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
//- (BOOL)startVideoCapture{
//    
//}

-(IBAction)startVideo:(id)sender {	

    UIImagePickerController *picker = [[UIImagePickerController alloc] init]; 
    picker.delegate = self; 
    
    
    
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeImage, nil];
    
    NSArray *sourceTypes = 
    [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType];
    if (![sourceTypes containsObject:(NSString *)kUTTypeVideo ]){
        NSLog(@"device not supported");
        return;
    }
    
    
    //NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; 
    
//    if ([sourceTypes containsObject:(NSString *)kUTTypeMovie ])
//   { 
////        NSLog(@"device not supported");
////        return; 
//    } 
//    picker.videoQuality = UIImagePickerControllerQualityTypeHigh; 
    [self presentModalViewController:picker animated:YES];	 
}

@end
